import com.spc.demo.business.Component;
import com.spc.demo.business.Leaf;
import com.spc.demo.business.Tree;

public class Client {
    public static void main(String[] args) throws Exception {
        Component root = new Tree("root tree");

        Component firstTree = new Tree("first tree");
        Component leaf1 = new Leaf("leaf one of first tree");
        Component leaf2 = new Leaf("leaf two of first tree");

        Component secondTree = new Tree("second tree");
        Component leaf3 = new Leaf("leaf one of second tree");
        Component leaf4 = new Leaf("leaf two of second tree");

        firstTree.add(leaf1);
        firstTree.add(leaf2);
        secondTree.add(leaf3);
        secondTree.add(leaf4);

        root.add(firstTree);
        root.add(secondTree);

        root.print();
    }
}
